home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Libris Britannia 4
/
science library(b).zip
/
science library(b)
/
UTILITIE
/
CPU_MEMO
/
3468.ZIP
/
POPUP.ZIP
/
POPUP.DOC
< prev
next >
Wrap
Text File
|
1988-06-30
|
3KB
|
103 lines
==============================================================
Documentation for the POPUP function, and associated utilities
==============================================================
All programs in POPUP.ARC assume Microsoft C 4.0 and later, and
MASM version 5.0 and later (although MASM 4.0 can be used with little
modification of sources).
The popup.arc file contains the following files:
1) clink.inc
This contains a set of MASM macros for interfacing C and Assembler
programs. It assumes MASM 5.0, but comments are included in the file
for using MASM 4.0
2) getkey.asm
Contains a keyboard function.
3) getstr.c
Contains code to read in a string using only the BIOS.
4) keycodes.h
Defines keycodes returned by the function in getkey.asm
5) peek.asm
Just contains a simple peek() routine.
6) popup.asm
Contains the code for the popup() function. See the documentation within
it for more details.
7) screenio.asm
Low level routines for writing directly to the screen RAM without flicker.
8) standard.h
A header file defining things like FOREVER etc.
9) windows.c
Code for handling (one-at-a-time) popup windows.
10) adjalloc.c
This is a stand-alone program to adjust the maximum allocation size of
a program in it's EXE header.
Compile it with : CL /Ox adjalloc.c
This program is useful for adjusting the max alloc size of popup
programs, because otherwise they gobble up heaps of memory.
Microsoft C looks at the maxalloc entry in the EXE header to determine
how much space to reserve for it in memory.
BE CAREFUL WITH THIS! Reducing the size too much causes crashes!
Run the program with no parameters for usage.
I use this in the makefiles for my popup programs.
11) windtest.c
An example program, demonstrating the POPUP routines.
To compile it and all the routines it needs:
MASM /ml popup;
MASM /ml screenio;
MASM /ml getkey;
MASM /ml peek;
CL /Ox adjalloc.c
CL /Ox windtest.c windows.c getstr.c screenio getkey popup peek
ADJALLOC windtest 10
Run the program, and press CTRL-ESC to pop it up.
Type in a line of text, and press return.
Some final notes
================
1) You can't malloc memory AFTER a program has popped up.
Malloc any memory before you call popup()
2) fopen() doesn't call malloc directly, but the first file access thereafter
will. Therefore, either use open() only, or call setvbuf() immediately
after opening the file.
(NOTE: In the 5.0 manual entry for setvbuf(), the word "not" is missing
from the line saying "The stream must refer to an open file which has
<<not!>> been read or written to since being opened"
3) You cannot do console I/O through DOS once popped up.
4) There may be other functions which cannot be used. Proceed with caution.
5) If you ARE using malloc, MAKE SURE that you reflect the total amount
malloced in the parameter to ADJALLOC if you are using it.
If you malloc 100 paragraphs, ADJALLOC at least 100 paragraphs.
I usually allow some extra, "just in case".